#include "PersonList.h"
#include "OutputListBox.h"
#include "OutputButton.h"
#include "FormatRadioButton.h"
#include <iostream>
#include <vector>
#include <string>

using namespace std;


PersonList::PersonList(DisplayFormat* displayFormat)
{
	personList_m.push_back(Person("San Chang", Length(61,INCH,displayFormat)));
	personList_m.push_back(Person("Si Li",   Length(67,INCH,displayFormat)));
	personList_m.push_back(Person("Wu Wang", Length(93,INCH,displayFormat)));
	personList_m.push_back(Person("Hui Qin", Length(54,INCH,displayFormat), 2));
	personList_m.push_back(Person("Fei Yue", Length(86,INCH,displayFormat), 2));	
	personList_m.push_back(Person("Gou Zhao", Length(64,INCH,displayFormat), 2));
}

ostream& operator<<(ostream& os, const PersonList& p)
{
     for (unsigned char groupFlag = MIN_PERSON_GROUP; groupFlag <= MAX_PERSON_GROUP; groupFlag++)
     {
	os << "Name\tHeigth\n";
	for(PersonList::PersonVec::const_iterator it = p.personList_m.begin(); it != p.personList_m.end(); ++it)
		const_cast<Person*>(&(*it))->displayByGroup(os,groupFlag);
        //os<<"\n";
     }
	//displayFormat_m->toStringFormat(os, 2);
}



